<?php
    defined('_JEXEC') or die(); 
    JHTML::_('behavior.tooltip'); 
    $listOrder    = @$this->lists['order'];
    $listDirn    = @$this->lists['order_Dir'];
    $user = &JFactory::getUser();
?>
<style>
    #tbl_filter{
        margin: 0 ; padding: 0 ;
    }
    #tbl_filter input, #tbl_filter img {
        float: left;
        margin: 5px 5px 5px 0;
        width: auto;
    }
}
</style>
<script language="javascript" type="text/javascript">
    function submitform(pressbutton){
        var form = document.adminForm ;
        //alert(pressbutton)
        if (pressbutton)
        {
            form.task.value=pressbutton ;
        }
        if ((pressbutton=='send_redemp_notice_email')||(pressbutton=='send_redemp_pick_up_notice')){
              form.controller.value="reports" ;
        }
        form.submit();
    }
</script>
<div class="col width-100">    
    <form id="adminForm" action="<?php echo JRoute::_("index.php?option=com_wrd")?>" method="post" name="adminForm" >
        <div id="editcell">
            <table width="100%" class="adminlist">
                <thead>
                    <tr>
                         <th width="3%">
                            &nbsp;
                        </th>
                        <th nowrap="nowrap" width="6%">
                             <?php echo JHTML::_('grid.sort',  'Member No', 'vip_number', $listDirn, $listOrder ); ?>
                         </th>        
                         <th nowrap="nowrap" width="14%">  
                             <?php echo JHTML::_('grid.sort',  'Member Name', 'f_name', $listDirn, $listOrder ); ?>
                         </th>   
                         <th nowrap="nowrap" width="6%">  
                             <?php echo JHTML::_('grid.sort',  'Check #', '`t`.transaction_id', $listDirn, $listOrder ); ?>
                         </th>
                         <th nowrap="nowrap" width="11%">  
                             <?php echo JHTML::_('grid.sort',  'Date', '`t`.date_receipt', $listDirn, $listOrder ); ?>
                         </th>
                         <th nowrap="nowrap" width="14%">  
                             <?php echo JHTML::_('grid.sort',  'Outlet', '`o`.NAME', $listDirn, $listOrder ); ?>
                         </th> 
                         <th nowrap="nowrap" width="4%">  
                             <?php echo JHTML::_('grid.sort',  'Pax', '`t`.pax', $listDirn, $listOrder ); ?>
                         </th>                             
                         <th nowrap="nowrap" width="8%">  
                             <?php echo JHTML::_('grid.sort',  'Total Spend', '`t`.total', $listDirn, $listOrder ); ?>
                         </th>                             
                         <th nowrap="nowrap" width="8%">  
                             <?php echo JHTML::_('grid.sort',  'Food', '``t`.food', $listDirn, $listOrder ); ?>
                         </th>                             
                         <th nowrap="nowrap" width="8%">  
                             <?php echo JHTML::_('grid.sort',  'Beverage', '`t`.beverage', $listDirn, $listOrder ); ?>
                         </th>                             
                         <th nowrap="nowrap" width="10%">  
                             <?php echo JHTML::_('grid.sort',  'Other', '`t`.other', $listDirn, $listOrder ); ?>
                         </th>   
                         <th nowrap="nowrap" width="8%">  
                             Points
                         </th>                                                       
                    </tr>
                </thead>
                <tbody>
                     <?php
                           $k = 0;
                           if(count($this->items) > 0):
                            for ($i=0, $n= count( $this->items ); $i < $n; $i++):
                                $row = &$this->items[$i];
                                //$checked     = JHTML::_('grid.checkedout',   $row, $i);
                        ?>    
                             <tr class="<?php echo "row$k"; ?>" >
                                <td>
                                    <?php echo($i+1); ?>
                                </td>
                                <td>
                                    V<?php echo $row->vip_number; ?>
                                </td>
                                <td>
                                    <?php echo $row->f_name.' '.$row->l_name; ?>
                                </td>
                                <td>
                                    <?php echo $row->check; ?>
                                </td>
                                <td>
                                    <?php echo $row->date; ?>
                                </td>
                                <td>
                                    <?php echo $row->outlet; ?>
                                </td>
                                <td>
                                    <?php echo $row->pax; ?>
                                </td>
                                <td>
                                    <?php echo $row->total; ?>
                                </td>
                                <td>
                                    <?php echo $row->food; ?>
                                </td>
                                <td>
                                    <?php echo $row->beverage; ?>
                                </td>
                                <td>
                                    <?php echo $row->other; ?>
                                </td>
                                <td>
                                    <?php echo $row->liquor; ?>
                                </td>
                             </tr>
                         <?php 
                             $k = 1 - $k ;     
                             endfor; 
                             endif; 
                         ?>
                     </tbody>
                     <tfoot>
                        <tr>
                            <td colspan="16">
                                <?php
                                     echo $this->pagination->getListFooter();
                                ?>
                            </td>
                        </tr>
                    </tfoot>
                </table>
        </div>
        <input type="hidden" name="controller" value="reports" />
        <input type="hidden" name="option" value="com_wrd" />
        <input type="hidden" name="task" value="transaction" />
        <input type="hidden" name="boxchecked" value="0" />
        <input type="hidden" name="filter_order" value="<?php echo $this->lists['order']; ?>" />
        <input type="hidden" name="filter_order_Dir" value="<?php echo $this->lists['order_Dir']; ?>" />
        <?php echo JHTML::_( 'form.token' ); ?>
    </form>
</div>
<?php 
    //$this->downloadFileExcel();
?>